<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>

</head>
<body>
    这个主要演示捕获冒泡阶段，元素执行顺序


    <div id="app">
        <div @click="outer">
            outer
            <div  @click.prevent="inner">
                inner
                <div @click="con">con</div>
            </div>
        </div>
        <form action="">
            <button @click.prevent="">点击</button>
        </form>
        <!-- 加入once属性后，该元素只会执行一次 -->
        <button @click.once="con">con</button>

        <div @click.self="con">123
            <div>456</div>
        </div>
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el:'#app',
            data(){
               return {
                    count:20,
                    
                }
            },
            methods: {
                outer(){
                    alert('outer')
                },
                inner(){
                    alert('inner')
                },
                con(){
                    alert('con')
                }
                
            },
        })


    </script>
</body>
</html>